﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Xml;
using System.Xml.Serialization;

namespace KSS.Generator.Schema
{
    [XmlRootAttribute("Database",
                    Namespace = "http://schemas.microsoft.com/linqtosql/dbml/2007",
                    IsNullable = false)]
    public class Database
    {
        private string _name;
        [XmlAttribute]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _class;
        [XmlAttribute]
        public string Class
        {
            get { return _class; }
            set { _class = value; }
        }

        private Connection _connection;
        [XmlElement(ElementName = "Connection", Type = typeof(Connection))]
        public Connection ConnectionString
        {
            get { return _connection; }
            set { _connection = value; }
        }

        private List<Table> _tables;        
        [XmlElement(ElementName = "Table", Type = typeof(Table))]
        public List<Table> Tables
        {
            get { return _tables; }
            set { _tables = value; }
        }

        private List<Function> _functions;
        [XmlElement(ElementName = "Function", Type = typeof(Function))]
        public List<Function> Functions
        {
            get { return _functions; }
            set { _functions = value; }
        }
    }
}
